package com.android.googlesettings.util;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class DateUtil {

	public static String getCurrentTime() {

		return String.valueOf(System.currentTimeMillis());
	}

	public static Calendar getCurrentCalendar() {

		return Calendar.getInstance();
	}

	public static String getCurrentDateToString() {
		
		return getDateByString(getCurrentTime());
	}

	public static String getDateByString(String timeMillis) {
		try {
			SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			return format.format(new Date(Long.parseLong(timeMillis)));
		} catch (Exception e) {
			LogUtil.e(e.toString());
		}
		return null;
	}
}
